package br.ufrj.viewclient;

import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

import com.cloudgarden.layout.AnchorConstraint;
import com.cloudgarden.layout.AnchorLayout;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class LoginPanel extends javax.swing.JPanel
{

	{
		// Set Look & Feel
		try
		{
			javax.swing.UIManager
					.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
		} catch (Exception e)
		{
			e.printStackTrace();
		}
	}

	private static final long serialVersionUID = 1L;

	private JLabel labelLogin;
	private JTextField textFieldLogin;
	private JPasswordField passwordFieldSenha;
	private JButton botaoLogar;
	private JButton botaoCancelar;
	private JLabel labelTitulo;
	private JLabel labelSenha;

	public LoginPanel()
	{
		super();
		initGUI();
	}

	public void setEventoBotaoLogar(ActionListener e)
	{
		botaoLogar.setActionCommand("loginpanel_botaoLogar");
		botaoLogar.addActionListener(e);
	}

	public void setEventoBotaoCancelar(ActionListener e)
	{
		botaoCancelar.setActionCommand("loginpanel_botaoCancelar");
		botaoCancelar.addActionListener(e);
	}

	private void initGUI()
	{
		try
		{
			AnchorLayout thisLayout = new AnchorLayout();
			this.setLayout(thisLayout);
			this.setPreferredSize(new java.awt.Dimension(700, 500));
			this.setSize(700, 500);
			this.setBackground(new java.awt.Color(169, 214, 176));
			{
				botaoLogar = new JButton();
				this.add(getlabelTitulo(), new AnchorConstraint(53, 840, 127,
						176, AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL));
				this.add(botaoLogar, new AnchorConstraint(765, 415, 863, 147,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL));
				botaoLogar.setText("LOGAR");
				botaoLogar.setPreferredSize(new java.awt.Dimension(187, 49));
				botaoLogar.setFont(new java.awt.Font("Arial Black", 1, 18));
			}
			{
				passwordFieldSenha = new JPasswordField();
				this.add(passwordFieldSenha, new AnchorConstraint(485, 972,
						563, 203, AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL));
				passwordFieldSenha.setPreferredSize(new java.awt.Dimension(538,
						39));
				passwordFieldSenha
						.setFont(new java.awt.Font("Segoe UI", 0, 24));
			}
			{
				textFieldLogin = new JTextField();
				this.add(textFieldLogin, new AnchorConstraint(319, 972, 397,
						203, AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL));
				textFieldLogin
						.setPreferredSize(new java.awt.Dimension(538, 39));
				textFieldLogin.setFont(new java.awt.Font("Segoe UI", 0, 24));
			}
			{
				labelSenha = new JLabel();
				this.add(labelSenha, new AnchorConstraint(479, 163, 547, 40,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL));
				labelSenha.setText("Senha");
				labelSenha.setPreferredSize(new java.awt.Dimension(86, 34));
				labelSenha.setFont(new java.awt.Font("Segoe UI", 1, 24));
			}
			{
				labelLogin = new JLabel();
				this.add(labelLogin, new AnchorConstraint(319, 217, 403, 40,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL));
				labelLogin.setText("Login:");
				labelLogin.setPreferredSize(new java.awt.Dimension(124, 42));
				labelLogin.setFont(new java.awt.Font("Segoe UI", 1, 26));
			}
			{
				botaoCancelar = new JButton();
				this.add(botaoCancelar, new AnchorConstraint(765, 892, 863,
						623, AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL,
						AnchorConstraint.ANCHOR_REL));
				botaoCancelar.setText("CANCELAR");
				botaoCancelar.setPreferredSize(new java.awt.Dimension(188, 49));
				botaoCancelar.setFont(new java.awt.Font("Arial Black", 1, 18));
			}
		} catch (Exception e)
		{
			e.printStackTrace();
		}
	}

	private JLabel getlabelTitulo()
	{
		if (labelTitulo == null)
		{
			labelTitulo = new JLabel();
			labelTitulo.setText("Insira seus dados cadastrais");
			labelTitulo.setPreferredSize(new java.awt.Dimension(465, 37));
			labelTitulo.setFont(new java.awt.Font("Arial Black", 1, 26));
		}
		return labelTitulo;
	}

}
